package hcn.util;

import java.io.Serializable;

/**
 * 返回值基础类
 *
 * @param <T>
 */
public class BaseResponse<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    private int code = 200;

    private String message;

    private T data;

    public BaseResponse() {
    }
    public BaseResponse(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "BaseResponse{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
